home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Session_VBScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.5 KB  |  59 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3.  
  4. <!*************************
  5. This sample is provided for educational purposes only. It is not intended to be 
  6. used in a production environment, has not been tested in a production environment, 
  7. and Microsoft will not provide technical support for it. 
  8. *************************>
  9.  
  10. <%
  11.     'Ensure that this page is not cached.
  12.  
  13.     Response.Expires = 0
  14. %>
  15.  
  16. <HTML>
  17.     <HEAD>
  18.         <TITLE>Using Session Variables</TITLE>
  19.     </HEAD>
  20.  
  21.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  22.  
  23.         <!-- Display header. -->
  24.  
  25.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  26.         <B>Using Session Variables</B></FONT><BR>
  27.       
  28.         <HR SIZE="1" COLOR="#000000">
  29.  
  30.  
  31.         <%
  32.             'If this is the first time a user has visited
  33.             'the page, initialize Session Value.
  34.  
  35.             If (Session("SessionCountVB") = "") Then 
  36.                 Session("SessionCountVB") = 0
  37.             End If
  38.  
  39.  
  40.             'Increment the Session PageCount by one.
  41.             'Note that this PageCount value is only
  42.             'for this user's individual session.
  43.  
  44.             Session("SessionCountVB") = Session("SessionCountVB") + 1
  45.         %>
  46.  
  47.  
  48.         <!-- Output the Session Page Counter Value. -->
  49.  
  50.         You have personally visited this page 
  51.         <%= Session("SessionCountVB") %> times!
  52.  
  53.  
  54.         <!-- Provide a link to revisit the page. -->
  55.         <P><A HREF="Session_VBScript.asp">Click here to visit it again</A>
  56.  
  57.     </BODY>
  58. </HTML>
  59.